/*
 * @Author: 
 * @Date: 2022-01-17 17:07:23
 * @LastEditors: lqj
 * @LastEditTime: 2022-01-17 17:39:37
 * @Description: 请填写简介
 */
import PropTypes from 'prop-types'

import React, { Component } from 'react'

const { string, node, object, element, oneOf, oneOfType, number, arrayOf, array, shape, any } = PropTypes

class InstDom extends Component {
  render() {
    return (
      <div>aaa</div>
    )
  }
}

const inst = new InstDom()

class ChildProp extends Component {
  static PropTypes = {
    title: string,
    node: node,
    obj: object,
    ele: node,
    dom: element,
    list: PropTypes.instanceOf(InstDom),
    types: oneOfType([string, number]),
    init(props, propName, componentName) {
      console.log(props, propName, componentName)
      // return new Error()
    }
  }
  render () {
    console.log(this.props.list)
    return (
      <>
        child props { this.props.title }
        <div>{ this.props.node } { this.props.obj.j }</div>
      </>
    )
  }
}

class DomRender extends Component {
  render() {
    return (
      <div>aaa</div>
    )
  }
}

export default class extends Component {
  render() {
      return (
        <>
          <ChildProp title={1} init={'init'} node={['a', 's']} obj={{ j: 1 }} list={inst} dom={<DomRender />} ele={<div>aaa</div>}></ChildProp>
        </>
      )
   }
}